import request from '@/utils/request'

// 查询应用列表
export function listapplicant(query) {
  return request({
    url: '/system/applicant/list',
    method: 'get',
    params: query
  })
}

// 查询应用详细
export function getapplicant(applicantId) {
  return request({
    url: '/system/applicant/' + applicantId,
    method: 'get'
  })
}

// 新增应用
export function addapplicant(data) {
  return request({
    url: '/system/applicant/add',
    method: 'post',
    data: data
  })
}

// 修改应用
export function updateapplicant(data) {
  return request({
    url: '/system/applicant/edit',
    method: 'put',
    data: data
  })
}
// 修改应用状态
export function changeRoleapplicantAvl(data) {
  return request({
    url: '/system/applicant/avl',
    method: 'post',
    data: data
  })
}
// 删除应用
export function delapplicant(applicantId) {
  return request({
    url: '/system/applicant/' + applicantId,
    method: 'delete'
  })
}

// 根据角色ID查询部门树结构
export function allTree(roleId) {
  return request({
    url: '/system/menu/tree/all/applicant',
    method: 'get'
  })
}
// 下发菜单
export function AppliMenu(data) {
  return request({
    url: '/system/menu/applicant/grant',
    method: 'post',
    data: data
  })
}